﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * ZIP Required Version Class
 * 		Represents and manages the version of pk-zip required to read an associated
 * file.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;

namespace Adaptive.Foundation.IO.Zip
{
    /// <summary>
    /// Represents and manages the version of pk-zip required to read an associated
    /// file.
    /// </summary>
    /// <remarks>
    /// This class representds the minimum supported ZIP specification version needed to 
    /// extract the associated file.  This value is based on the specific format features a ZIP 
    /// program must support to be able to extract the file.  If multiple features are
    /// applied to a file, the minimum version should be set to the feature having the highest value. 
    /// New features or feature changes affecting the published format specification will be 
    /// implemented using higher version numbers than the last published value to avoid conflict.
    /// </remarks>
    public sealed class ZipRequiredVersion : ZipVersionBase
    {
        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the <see cref="ZipRequiredVersion" /> class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public ZipRequiredVersion()
            : base()
        {
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZipRequiredVersion" /> class.
        /// </summary>
        /// <param name="majorVersion">The major version.</param>
        /// <param name="minorVersion">The minor version.</param>
        public ZipRequiredVersion(byte majorVersion, byte minorVersion)
            : base(majorVersion, minorVersion)
        {
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZipRequiredVersion" /> class.
        /// </summary>
        /// <param name="value">The short integer value containing the versioning data.</param>
        public ZipRequiredVersion(short value)
            : base(value)
        {
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Properties
         *------------------------------------------------------------------------------*/
        #region Public Properties
        /// <summary>
        /// Gets or sets the major version number.
        /// </summary>
        /// <value>The major version number.</value>
        public byte MajorVersion
        {
            get
            {
                return HighByte;
            }
            set
            {
                HighByte = value;
            }
        }
        /// <summary>
        /// Gets or sets the minor version number.
        /// </summary>
        /// <value>The minor version number.</value>
        public byte MinorVersion
        {
            get
            {
                return LowByte;
            }
            set
            {
                LowByte = value;
            }
        }
        #endregion
    }
}
